/*
 * Copyright (C) Hisilicon Technologies Co., Ltd. 2012-2019. All rights reserved.
 * Description: Function of yuv_cmos_ex.h
 * Author: ISP SW
 * Create: 2012/06/28
 */

#ifndef __YUV_CMOS_EX_H_
#define __YUV_CMOS_EX_H_

#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif

static const hi_isp_cmos_ca g_yuv_isp_ca = {
    /* CA */
    1,
    /* Y */
    {
        36, 81, 111, 136, 158, 182, 207, 228, 259, 290, 317, 345, 369, 396, 420, 444,
        468, 492, 515, 534, 556, 574, 597, 614, 632, 648, 666, 681, 697, 709, 723, 734,
        748, 758, 771, 780, 788, 800, 808, 815, 822, 829, 837, 841, 848, 854, 858, 864,
        868, 871, 878, 881, 885, 890, 893, 897, 900, 903, 906, 909, 912, 915, 918, 921,
        924, 926, 929, 931, 934, 936, 938, 941, 943, 945, 947, 949, 951, 952, 954, 956,
        958, 961, 962, 964, 966, 968, 969, 970, 971, 973, 974, 976, 977, 979, 980, 981,
        983, 984, 985, 986, 988, 989, 990, 991, 992, 993, 995, 996, 997, 998, 999, 1000,
        1001, 1004, 1005, 1006, 1007, 1009, 1010, 1011, 1012, 1014, 1016, 1017, 1019, 1020, 1022, 1024
    },
    /* ISO */
    {1300, 1300, 1250, 1200, 1150, 1100, 1050, 1000, 950, 900, 900, 800, 800, 800, 800, 800}
};

static const hi_isp_cmos_sharpen g_yuv_isp_yuv_sharpen = {
    /* u8SkinUmin */
    100,
    /* u8SkinVmin */
    135,
    /* u8SkinUmax */
    128,
    /* u8SkinVmax */
    150,
    /* Manual Para */
    {
        /* au8LumaWgt[ISP_SHARPEN_LUMA_NUM] */
        {127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127,
         127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127,  127, 127, 127, 127
        },
        /* u16TextureStr[ISP_SHARPEN_GAIN_NUM] */
        {250, 420, 390, 390, 390, 390, 390, 370, 350, 330, 310, 290, 270, 270, 270, 270,
         270, 270, 266, 260, 244, 230, 230, 230, 230, 230, 230, 210, 190, 190, 170, 150
        },
        /* u16EdgeStr[ISP_SHARPEN_GAIN_NUM] */
        {120, 123, 125, 128, 130, 135, 140, 148, 160, 168, 180, 190, 200, 210, 210, 210,
         210, 210, 200, 190, 185, 175, 165, 160, 146, 136, 130, 128, 125, 123, 120, 120
        },
        /* u16TextureFreq */
        190,
        /* u16EdgeFreq */
        128,
        /* u8OverShoot */
        65,
        /* u8UnderShoot */
        75,
        /* u8shootSupStr */
        7,
        /* u8shootSupAdj */
        9,
        /* u8DetailCtrl */
        128,
        /* u8DetailCtrlThr */
        180,
        /* u8EdgeFiltStr */
        60,
        /* u8EdgeFiltMaxCap */
        18,
        /* u8RGain */
        20,
        /* u8GGain */
        32,
        /* u8BGain */
        20,
        /* u8SkinGain */
        25,
        /* u8MaxSharpGain */
        40
    },
    /* Auto Para */
    {
        /* au16LumaWgt[ISP_SHARPEN_GAIN_NUM][ISP_AUTO_ISO_STRENGTH_NUM] */
        {   { 127, 127, 127, 127, 127,  80,   75,   75,   75,    75,   60,    60,    60,    60,      60,    60},
            { 127, 127, 127, 127, 127,  80,   75,   75,   75,    75,   60,    60,    60,    60,      60,    60},
            { 127, 127, 127, 127, 127,  80,   75,   75,   75,    75,   60,    60,    60,    60,      60,    60},
            { 127, 127, 127, 127, 127,  85,   75,   75,   75,    75,   60,    60,    60,    60,      60,    60},
            { 127, 127, 127, 127, 127,  90,   75,   75,   75,    75,   60,    60,    60,    60,      60,    60},
            { 127, 127, 127, 127, 127,  95,   80,   80,   80,    80,   60,    60,    60,    60,      60,    60},
            { 127, 127, 127, 127, 127, 100,   85,   85,   85,    85,   72,    72,    72,    72,      72,    72},
            { 127, 127, 127, 127, 127, 105,   90,   90,   90,    90,   85,    85,    85,    85,      85,    85},
            { 127, 127, 127, 127, 127, 110,  100,  100,  100,   100,  100,   100,   100,   100,     100,   100},
            { 127, 127, 127, 127, 127, 120,  114,  114,  114,   114,  114,   114,   114,   114,     114,   114},
            { 127, 127, 127, 127, 127, 127,  127,  127,  127,   127,  127,   127,   127,   127,     127,   127},
            { 127, 127, 127, 127, 127, 127,  127,  127,  127,   127,  127,   127,   127,   127,     127,   127},
            { 127, 127, 127, 127, 127, 127,  127,  127,  127,   127,  127,   127,   127,   127,     127,   127},
            { 127, 127, 127, 127, 127, 127,  127,  127,  127,   127,  127,   127,   127,   127,     127,   127},
            { 127, 127, 127, 127, 127, 127,  127,  127,  127,   127,  127,   127,   127,   127,     127,   127},
            { 110, 127, 127, 127, 127, 127,  127,  127,  127,   127,  127,   127,   127,   127,     127,   127},
            {  90, 127, 127, 127, 127, 127,  127,  127,  127,   127,  127,   127,   127,   127,     127,   127},
            {  90, 127, 127, 127, 127, 127,  127,  127,  127,   127,  127,   127,   127,   127,     127,   127},
            {  90, 127, 127, 127, 127, 127,  127,  127,  127,   127,  127,   127,   127,   127,     127,   127},
            {  90, 127, 127, 127, 127, 127,  127,  127,  127,   127,  127,   127,   127,   127,     127,   127},
            {  90, 127, 127, 110, 110, 127,  127,  127,  127,   127,  127,   127,   127,   127,     127,   127},
            {  90, 127, 127, 110, 110, 127,  127,  127,  127,   127,  127,   127,   127,   127,     127,   127},
            {  90, 127, 127, 110, 110, 127,  127,  127,  127,   127,  127,   127,   127,   127,     127,   127},
            {  90, 127, 127, 110, 110, 127,  127,  127,  127,   127,  127,   127,   127,   127,     127,   127},
            {  90, 127, 127, 110, 110, 127,  127,  127,  127,   127,  127,   127,   127,   127,     127,   127},
            {  90, 127, 127, 100, 100, 127,  127,  127,  127,   127,  127,   127,   127,   127,     127,   127},
            {  90, 127, 127, 100, 100, 127,  127,  127,  127,   127,  127,   127,   127,   127,     127,   127},
            {  90, 127, 127, 100, 100, 127,  127,  127,  127,   127,  127,   127,   127,   127,     127,   127},
            {  90, 127, 127, 100, 100, 127,  127,  127,  127,   127,  127,   127,   127,   127,     127,   127},
            {  90, 127, 127, 100, 100, 127,  127,  127,  127,   127,  127,   127,   127,   127,     127,   127},
            {  90, 127, 127, 100, 100, 127,  127,  127,  127,   127,  127,   127,   127,   127,     127,   127},
            {  90, 127, 127, 100, 100, 127,  127,  127,  127,   127,  127,   127,   127,   127,     127,   127}
        },
        /* au16TextureStr[ISP_SHARPEN_GAIN_NUM][ISP_AUTO_ISO_STRENGTH_NUM] */
        {   {160, 160, 160, 145, 130, 130, 130, 105, 105, 105, 105,  85,  85,  85,  85,  85},
            {200, 200, 190, 170, 145, 145, 145, 120, 120, 120, 120, 100, 100, 100, 100, 100},
            {240, 240, 220, 195, 165, 165, 160, 140, 140, 135, 135, 120, 120, 120, 120, 120},
            {265, 265, 255, 215, 180, 180, 175, 160, 160, 150, 150, 135, 135, 140, 140, 140},
            {290, 290, 275, 230, 200, 200, 185, 175, 175, 160, 160, 150, 150, 160, 160, 160},
            {295, 295, 285, 245, 210, 215, 200, 190, 190, 170, 170, 165, 165, 180, 180, 180},
            {290, 290, 280, 260, 225, 225, 215, 205, 205, 180, 180, 185, 185, 200, 200, 200},
            {280, 280, 275, 265, 240, 240, 230, 220, 220, 190, 190, 200, 200, 210, 210, 210},
            {270, 270, 270, 270, 250, 250, 240, 225, 225, 200, 200, 220, 220, 220, 220, 220},
            {270, 270, 265, 270, 250, 260, 245, 235, 235, 210, 210, 235, 235, 230, 230, 230},
            {270, 270, 260, 265, 250, 270, 255, 245, 245, 220, 220, 245, 245, 230, 230, 230},
            {265, 265, 260, 260, 250, 275, 260, 250, 250, 230, 230, 255, 255, 230, 230, 230},
            {260, 260, 255, 255, 245, 280, 265, 255, 255, 235, 235, 265, 265, 230, 230, 230},
            {255, 255, 250, 250, 240, 285, 270, 255, 255, 240, 240, 275, 275, 230, 230, 230},
            {250, 250, 245, 245, 240, 290, 275, 250, 255, 245, 245, 280, 280, 230, 230, 230},
            {250, 250, 240, 240, 240, 295, 280, 240, 250, 250, 250, 285, 285, 230, 230, 230},
            {245, 245, 235, 235, 235, 295, 280, 235, 250, 250, 255, 290, 290, 230, 230, 230},
            {245, 245, 230, 230, 230, 290, 280, 230, 250, 250, 260, 295, 295, 230, 230, 230},
            {240, 240, 225, 225, 225, 285, 275, 225, 245, 250, 265, 300, 300, 225, 225, 225},
            {240, 240, 225, 220, 220, 275, 270, 225, 245, 250, 270, 300, 300, 220, 220, 220},
            {235, 235, 220, 215, 215, 270, 265, 225, 240, 245, 275, 300, 300, 210, 210, 210},
            {235, 235, 220, 210, 210, 260, 260, 220, 235, 245, 280, 305, 305, 200, 200, 200},
            {230, 230, 215, 205, 205, 255, 255, 220, 230, 240, 280, 305, 305, 190, 190, 190},
            {230, 230, 215, 200, 200, 245, 245, 220, 230, 240, 285, 310, 310, 180, 180, 180},
            {225, 225, 210, 195, 195, 235, 240, 215, 225, 235, 285, 310, 310, 175, 175, 175},
            {220, 220, 200, 190, 190, 230, 235, 215, 220, 230, 285, 305, 305, 170, 170, 170},
            {210, 210, 195, 180, 180, 220, 225, 210, 220, 225, 285, 305, 305, 160, 160, 160},
            {205, 205, 185, 175, 175, 205, 220, 205, 215, 220, 285, 300, 300, 160, 160, 160},
            {190, 190, 175, 170, 170, 195, 210, 195, 210, 215, 280, 300, 300, 150, 150, 150},
            {180, 180, 170, 160, 160, 180, 205, 195, 205, 210, 280, 300, 300, 145, 145, 145},
            {165, 165, 160, 155, 155, 165, 195, 195, 200, 205, 275, 300, 300, 130, 130, 130},
            {150, 150, 150, 150, 150, 150, 150, 150, 195, 200, 270, 300, 300, 115, 115, 115}
        },
        /* au16EdgeStr */
        {   {195, 195, 195, 195, 195, 195, 400, 440, 500, 475, 475, 475, 475, 475, 475, 475},
            {210, 210, 200, 200, 200, 200, 400, 440, 500, 485, 485, 485, 485, 485, 485, 485},
            {235, 235, 220, 220, 220, 220, 400, 440, 500, 495, 495, 495, 495, 495, 495, 495},
            {260, 260, 230, 230, 230, 230, 400, 440, 500, 500, 500, 500, 500, 500, 500, 500},
            {295, 295, 240, 240, 240, 240, 400, 440, 500, 510, 510, 510, 510, 510, 510, 510},
            {320, 320, 250, 250, 250, 250, 400, 440, 500, 520, 520, 520, 520, 520, 520, 520},
            {340, 340, 260, 260, 260, 260, 420, 460, 540, 530, 530, 530, 530, 530, 530, 530},
            {350, 350, 270, 270, 270, 270, 420, 460, 540, 540, 540, 540, 540, 540, 540, 540},
            {360, 360, 280, 280, 280, 280, 420, 460, 540, 545, 545, 545, 545, 545, 545, 545},
            {360, 360, 280, 280, 280, 280, 420, 460, 540, 550, 550, 550, 550, 550, 550, 550},
            {355, 355, 285, 285, 285, 285, 420, 460, 540, 560, 560, 560, 560, 560, 560, 560},
            {345, 345, 290, 290, 290, 290, 420, 460, 540, 565, 565, 565, 565, 565, 565, 565},
            {335, 335, 290, 290, 290, 290, 420, 460, 540, 570, 570, 570, 570, 570, 570, 570},
            {330, 330, 295, 295, 295, 295, 430, 470, 550, 575, 575, 575, 575, 575, 575, 575},
            {325, 325, 295, 295, 295, 295, 430, 470, 550, 580, 580, 580, 580, 580, 580, 580},
            {320, 320, 295, 295, 295, 295, 440, 470, 550, 575, 575, 575, 575, 575, 575, 575},
            {315, 315, 295, 295, 295, 295, 440, 470, 550, 570, 570, 570, 570, 570, 570, 570},
            {310, 310, 295, 295, 295, 295, 450, 480, 580, 565, 565, 565, 565, 565, 565, 565},
            {305, 305, 295, 295, 295, 295, 460, 500, 580, 560, 560, 560, 560, 560, 560, 560},
            {295, 295, 290, 290, 290, 290, 460, 500, 580, 555, 555, 555, 555, 555, 555, 555},
            {285, 285, 285, 285, 285, 285, 460, 500, 580, 550, 550, 550, 550, 550, 550, 550},
            {280, 280, 280, 280, 280, 280, 460, 500, 580, 540, 540, 540, 540, 540, 540, 540},
            {275, 275, 275, 275, 275, 275, 460, 500, 580, 535, 535, 535, 535, 535, 535, 535},
            {265, 265, 265, 265, 265, 265, 460, 500, 580, 530, 530, 530, 530, 530, 530, 530},
            {250, 250, 250, 250, 250, 250, 460, 500, 580, 520, 520, 520, 520, 520, 520, 520},
            {240, 240, 240, 240, 240, 240, 470, 500, 580, 515, 515, 515, 515, 515, 515, 515},
            {220, 220, 220, 220, 220, 220, 470, 500, 580, 510, 510, 510, 510, 510, 510, 510},
            {200, 200, 200, 200, 200, 200, 470, 500, 580, 500, 500, 500, 500, 500, 500, 500},
            {180, 180, 180, 180, 180, 180, 480, 500, 580, 495, 495, 495, 495, 495, 495, 495},
            {160, 160, 160, 160, 160, 160, 480, 500, 580, 485, 485, 485, 485, 485, 485, 485},
            {140, 140, 140, 140, 140, 140, 480, 500, 580, 480, 480, 480, 480, 480, 480, 480},
            {125, 125, 125, 125, 125, 125, 480, 500, 580, 470, 470, 470, 470, 470, 470, 470}
        },
        /* au16TextureFreq[ISP_AUTO_ISO_STRENGTH_NUM] */
        {180, 190, 190, 170, 160, 160, 128, 128, 128, 128, 128, 100, 100, 100, 100, 100},
        /* au16EdgeFreq[ISP_AUTO_ISO_STRENGTH_NUM] */
        {128, 100, 100, 100, 100, 100, 100, 100, 100, 100, 96, 96, 96, 96, 96, 96},
        /* au8OverShoot[ISP_AUTO_ISO_STRENGTH_NUM] */
        {65, 68, 70, 76, 80, 80, 70, 70, 50, 50, 30, 10, 10, 10, 10, 10},
        /* au8UnderShoot[ISP_AUTO_ISO_STRENGTH_NUM] */
        {68, 75, 75, 80, 80, 80, 80, 70, 50, 30, 20, 20, 15, 15, 15, 15},
        /* au8ShootSupStr[ISP_AUTO_ISO_STRENGTH_NUM] */
        {8, 8, 7, 7, 7, 6, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0},
        /* au8ShootSupAdj[ISP_AUTO_ISO_STRENGTH_NUM] */
        {9, 9, 8, 8, 7, 7, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0},
        /* au8DetailCtrl[ISP_AUTO_ISO_STRENGTH_NUM] */
        {128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 120, 120, 120, 120, 120, 120},
        /* au8DetailCtrlThr[ISP_AUTO_ISO_STRENGTH_NUM] */
        {180, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160},
        /* au8EdgeFiltStr[ISP_AUTO_ISO_STRENGTH_NUM] */
        {60, 58, 60, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62},
        /* au8EdgeFiltMaxCap[ISP_AUTO_ISO_STRENGTH_NUM] */
        { 18,   18,    18,  18,    18,   18,    18,    18,      18,   18,    18,    18,    18,    18,    18,   18 },
        /* au8RGain[ISP_AUTO_ISO_STRENGTH_NUM] */
        {12, 16, 20, 24, 24, 24, 26, 28, 31, 31, 31, 31, 31, 31, 31, 31},
        /* au8GGain[ISP_AUTO_ISO_STRENGTH_NUM] */
        {32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32},
        /* au8BGain[ISP_AUTO_ISO_STRENGTH_NUM] */
        {18, 20, 24, 24, 24, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22},
        /* au8SkinGain[ISP_AUTO_ISO_STRENGTH_NUM] */
        {30, 30, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31},
        /* u8MaxSharpGain[ISP_AUTO_ISO_STRENGTH_NUM] */
        {30, 30, 30, 30, 30, 26, 20, 20, 18, 18, 18, 18, 18, 18, 18, 18}
    },
};

static const  hi_isp_cmos_edgemark g_yuv_isp_edge_mark = {
    0,          // HI_BOOL bEnable;
    100,        // HI_U8     u8Threshold;
    0xFF0000,   // HI_U32    u32Color;
};

static const hi_isp_cmos_ldci g_yuv_isp_ldci = {
    /* bEnable */
    1,
    /* u8GaussLPFSigma */
    36,

    /* au8HePosWgt */
    {70, 45, 42, 40, 35, 32, 12, 8, 6, 0, 0, 0, 0, 0, 0, 0},
    /* au8HePosSigma */
    {80, 80, 70, 70, 70, 64, 24, 20, 12, 8, 6, 2, 1, 1, 1, 1},
    /* au8HePosMean */
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},

    /* au8HeNegWgt */
    {60, 45, 45, 45, 45, 24, 12, 8, 6, 0, 0, 0, 0, 0, 0, 0},
    /* au8HeNegSigma */
    {80, 80, 80, 80, 80, 72, 64, 54, 36, 8, 6, 2, 1, 1, 1, 1},
    /* au8HeNegMean */
    {128, 128, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},

    /* au16BlcCtrl */
    {20, 20, 20, 20, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30}
};

static const hi_isp_cmos_dng_color_param g_yuv_dng_color_param = {
    {378, 256, 430},
    {439, 256, 439}
};

#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif /* End of #ifdef __cplusplus */

#endif /* __YUV_CMOS_EX_H_ */
